package com.code.platform.mongo.modules.entity;

import org.ietf.jgss.Oid;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;

/**
 * @author liuyj
 * @create 2017-08-09 16:04
 **/
@Document
public class User implements Serializable {

    private static final long serialVersionUID = 1585018254323767557L;


    private Oid id;

    /**
     * 用户名
     */
    @Field
    private String name;

    /**
     * 密码
     */
    @Field
    private String password;

    /**
     * 邮箱
     */
    @Field
    private String email;

    /**
     * 手机
     */
    @Field
    private String phone;

    /**
     * 注册时间
     */
    @Field(value = "register_time")
    private Date registerTime;

    /**
     * ip地址
     */
    @Field
    private String ip;


    public Oid getId() {
        return id;
    }

    public void setId(Oid id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", registerTime=" + registerTime +
                ", ip='" + ip + '\'' +
                '}';
    }
}
